const FontColorType = {
    'bold': ['\x1B[1m', '\x1B[22m'],
    'italic': ['\x1B[3m', '\x1B[23m'],
    'underline': ['\x1B[4m', '\x1B[24m'],
    'inverse': ['\x1B[7m', '\x1B[27m'],
    'strikethrough': ['\x1B[9m', '\x1B[29m'],
    'white': ['\x1B[37m', '\x1B[39m'],
    'grey': ['\x1B[90m', '\x1B[39m'],
    'black': ['\x1B[30m', '\x1B[39m'],
    'blue': ['\x1B[34m', '\x1B[39m'],
    'cyan': ['\x1B[36m', '\x1B[39m'],
    'green': ['\x1B[32m', '\x1B[39m'],
    'magenta': ['\x1B[35m', '\x1B[39m'],
    'red': ['\x1B[31m', '\x1B[39m'],
    'yellow': ['\x1B[33m', '\x1B[39m']
}



const logger = {
    info: (message?: any, ...optionalParams: any[]) => {
        const Layout = `[${new Date().getHours()}:${new Date().getMinutes()}:${new Date().getSeconds()}]`
        optionalParams.length != 0 ? console.info(`${FontColorType.white[0]}${Layout}[INFO]`, message, optionalParams) : console.info(`${FontColorType.white[0]}${Layout}[INFO]`, message);
    },
    warn: (message?: any, ...optionalParams: any[]) => {
        const Layout = `[${new Date().getHours()}:${new Date().getMinutes()}:${new Date().getSeconds()}]`
        optionalParams.length != 0 ? console.warn(`${FontColorType.yellow[0]}${Layout}[WARN]`, message, optionalParams) : console.warn(`${FontColorType.yellow[0]}${Layout}[WARN]`, message);
    },
    error: (message?: any, ...optionalParams: any[]) => {
        const Layout = `[${new Date().getHours()}:${new Date().getMinutes()}:${new Date().getSeconds()}]`
        optionalParams.length != 0 ? console.error(`${FontColorType.red[0]}${Layout}[ERROR]`, message, optionalParams) : console.error(`${FontColorType.red[0]}${Layout}[ERROR]`, message);
    },
    debug: (message?: any, ...optionalParams: any[]) => {
        const Layout = `[${new Date().getHours()}:${new Date().getMinutes()}:${new Date().getSeconds()}]`
        optionalParams.length != 0 ? console.debug(`${FontColorType.blue[0]}${Layout}[DEBUG]`, message, optionalParams) : console.error(`${FontColorType.red[0]}${Layout}[ERROR]`, message);
    }
}

export default logger